package com.hc.service;

import com.hc.mapper.OrderMapper;
import com.hc.domain.Order;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class OrderServiceImpl implements OrderService {

    @Autowired
    OrderMapper orderMapper;

    @Override
    public void addOrder(Order order) {


        if (order.getId() == null) {
            order.setId(System.nanoTime());
        }
        orderMapper.addOrder(order);
    }
}
